﻿using DotNetty.Buffers;
using QQ.Client;

namespace QQ.Packet.Request.TLV
{
    public class TLV0x18 : IRequest
    {
        public uint uin { get; set; }
        private short ping_version { get; set; } = 1;
        private int sso_version { get; set; } = 1536;
        private short constant1_always_0 { get; set; } = 0;
        private readonly QQDeviceConfig config;
        public TLV0x18(QQDeviceConfig config)
        {
            this.config = config;
        }
        public IByteBuffer Serialize() => Unpooled.Buffer()
            .WriteShort(ping_version)
            .WriteInt(sso_version)
            .WriteInt((int)config.appId)
            .WriteInt(config.appClientVersion)
            .WriteInt((int)uin)
            .WriteShort(constant1_always_0)
            .WriteShort(0);
    }
}